package com.hl.sfzy.exception;

import com.hl.sfzy.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionController {

        @ExceptionHandler(Exception.class)
        //e表示当前请求处理中出现的异常对象
        public R handleException(Exception e){
            System.out.println(e);
            return R.error("服务器异常，请稍后再试！");
        }
}
